'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
	//event为客户端上传的参数
	// ok  1通过  0审核 -1没通过
	// let type = event.type
	// let type = event.type
	let type = event.type
	if (type == 'ok') {
		return await db.collection('post').skip(parseInt(event.page)).limit(parseInt(event.limit)).where({
			ok: 1
		}).orderBy("time","desc").get()
	}else{
		return await db.collection('post').where({
			ok: 0
		}).get()
	}

	//返回数据给客户端

};
